package com.bbeginner.learn.no3;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;


import com.bbeginner.learn.R;
import com.bbeginner.learn.no3.Picker.DatePickerActivity;
import com.bbeginner.learn.no3.View.GridViewActivity;
import com.bbeginner.learn.no3.View.ListViewActivity;
import com.bbeginner.learn.no3.ViewPager.LaunchImproveActivity;
import com.bbeginner.learn.no3.ViewPager.LaunchSimpleActivity;
import com.bbeginner.learn.no3.practice.CalendarActivity;
import com.bbeginner.learn.no3.practice.ScheduleActivity;
import com.bbeginner.learn.no3.practice.VibratorActivity;
import com.bbeginner.learn.no4.practice.ShoppingChannelActivity;

public class Main3Activity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);

        initView();
    }

    private void initView() {
        findViewById(R.id.btn_grid_view).setOnClickListener(this);
        findViewById(R.id.btn_grid_channel).setOnClickListener(this);
        findViewById(R.id.btn_list_view).setOnClickListener(this);
        findViewById(R.id.btn_vibrator).setOnClickListener(this);
        findViewById(R.id.btn_calendar).setOnClickListener(this);
        findViewById(R.id.btn_schedule).setOnClickListener(this);
        findViewById(R.id.btn_launch_simple).setOnClickListener(this);
        findViewById(R.id.btn_launch_improve).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_date_picker) {
            Intent intent = new Intent(this, DatePickerActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_grid_view) {
            Intent intent = new Intent(this, GridViewActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_grid_channel) {
            Intent intent = new Intent(this, ShoppingChannelActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_list_view) {
            Intent intent = new Intent(this, ListViewActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_vibrator) {
            Intent intent = new Intent(this, VibratorActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_calendar) {
            Intent intent = new Intent(this, CalendarActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_schedule) {
            Intent intent = new Intent(this, ScheduleActivity.class);
            startActivity(intent);
        }else if (v.getId() == R.id.btn_launch_simple) {
            Intent intent = new Intent(this, LaunchSimpleActivity.class);
            startActivity(intent);
        }else if (v.getId() == R.id.btn_launch_improve) {
            Intent intent = new Intent(this, LaunchImproveActivity.class);
            startActivity(intent);
        }
    }
}